const fs = require('node:fs')


function readJsonAsObject(path) {
    var json = fs.readFileSync(path, {encoding: 'utf-8'})
    var obj = JSON.parse(json)
    return obj
}

function writeObjectAsJson(path, obj) {
    var json = JSON.stringify(obj)
    fs.writeFileSync(path, json, {encoding: 'utf-8'})
    return obj
}


module.exports = {
    readJsonAsObject: readJsonAsObject,
    writeObjectAsJson: writeObjectAsJson
}
